/* eslint-disable */
/**
/**
 * Created by GYL on 2018/7/25
 */
//新增子事件
import React, { Component } from 'react';
import { Collapse, Icon, Select, Input, Tooltip, Form, Row, Col, TreeSelect, Tag, Tree, Divider, message, Spin, Popconfirm } from 'antd';
import Util from '../../../utils/Util';
import config from '../../../config';
import request from '../../../utils/request';
import styles from '../index.less';
import PublicTemplate from '../../../services/PublicTemplate';
import { AllsonArrList, sonArrList, findOne } from './config';
const IconFont = Icon.createFromIconfontCN({
    scriptUrl: '//at.alicdn.com/t/font_1315525_kt2bd7ytf.js',
});
const { TextArea } = Input;
const { SHOW_CHILD } = TreeSelect;
const { TreeNode } = Tree;
class SubEvent extends Component {
    state = {
        spinning: false,
        solidType: '1',
        tableData: [],
        upDis: true,
        flag: false,
        sonArrList: sonArrList,
        treeArr: [],
        expandedKeys: [],
        autoExpandParent: true,
        treeData: [],
        selectedKeys: [],
        getTreeDataAn: [],//安全提示部门下拉树
        dutyTreeData: [],        //责任部门下拉树
        allTreeData: [],         //下拉树全部数据

    };
    componentDidMount() {

        request({
            url: '/pm-web/projectmanage/role/getTreeData',
            method: 'POST',
            data: { parentId: '', roleLevel: "" }
        }).then(data => {
            // console.log(data)
            if (data.rc === 0) {
                this.state.sonArrList[5].treeData = data.ret
                //设置为返回数组第一用户
                this.setState(
                    {
                        sonArrList: this.state.sonArrList
                    },
                    () => {
                        //给子级确认部门焦点
                        // this.props.form.validateFields(['confirmUserRoleId'], { force: true });
                    },
                );
            }
        })

        //根据事件id获取子级事件树结构
        request({
            url: '/pm-web/projectmanage/subeventsbasicinfo/getTreeByEventBasicId',
            method: 'POST',
            data: { eventBasicId: this.props.eventBasicId }
        }).then(data => {

            if (data.rc === 0) {
                this.setState({
                    treeData: data.ret.treeList,
                    selectedKeys: data.ret.defaultStr,
                    expandedKeys: data.ret.treeId
                })

                //根据id获取详情 控制各种按钮的状态
                request({
                    url: '/pm-web/projectmanage/subeventsbasicinfo/findOne',
                    method: 'POST',
                    data: { subeventsBasicId: data.ret.defaultStr[0] }
                }).then(data => {
                    // console.log(data)
                    if (data.rc === 0) {
                        this.setState({
                            shanChu: data.ret.shanChu,
                            shangYi: data.ret.shangYi,
                            xiaYi: data.ret.xiaYi,
                            xinZengTongJi: data.ret.xinZengTongJi,
                            xinZengXiaJi: data.ret.xinZengXiaJi,
                            parentEventId: data.ret.object.parentEventId,
                            hierarchy: data.ret.object.hierarchy,
                            eventBasicId: this.props.eventBasicId,
                            subeventsBasicId: data.ret.object.subeventsBasicId,
                            insertOrUpdate: data.ret.insertOrUpdate,//1新增2编辑
                        })
                    }
                })

            }
        })


        //查询子级责任部门
        request({
            url: '/pm-web/projectmanage/role/getTreeData',
            method: 'POST',
            data: { parentId: "", roleLevel: 1 }
        }).then(data => {
            this.state.sonArrList[2].treeData = data.ret
            AllsonArrList[2].treeData = data.ret
            this.setState({
                sonArrList: this.state.sonArrList,
                dutyTreeData: data.ret
            })
        })

        let params = {}
        request({
            url: '/pm-web/projectmanage/role/getTreeData',
            method: 'POST',
            data: params
        }).then(data => {
            this.state.sonArrList[4].treeData = data.ret
            this.state.sonArrList[5].treeData = data.ret
            AllsonArrList[4].treeData = data.ret
            AllsonArrList[5].treeData = data.ret
            this.setState({
                sonArrList: this.state.sonArrList,
                allTreeData: data.ret,
                treeArr: data.ret
            })
        })

        //获取安全提示部门选择下拉树
        request({
            url: '/pm-web/projectmanage/role/getTreeData',
            method: 'POST',
            data: {}
        }).then(data => {
            AllsonArrList[8].treeData = data.ret
            this.state.sonArrList[8].treeData = data.ret
            this.setState({
                sonArrList: this.state.sonArrList,
                getTreeDataAn: data.ret,
            })
        })
    };
    // modal保存
    onModalSave = () => {
        //根据this.state.insertOrUpdate 区分新增或编辑 1新增 2编辑
        this.props.form.validateFieldsAndScroll((err, v) => {
            if (!err) {
                //新增保存
                v.assistanceDepartmentRoleIdList = v.assistanceDepartmentRoles
                v.eventAuditRoleIdList = v.eventAuditRoleList
                v.eventAuditCCRoleIdList = v.eventAuditCCRoleList
                v.assistanceDepartmentRoles = []
                v.eventAuditCCRoleList = []
                v.eventAuditRoleList = []
                v.parentEventId = this.state.parentEventId
                v.hierarchy = this.state.hierarchy
                v.eventBasicId = this.props.eventBasicId
                v.subeventsBasicId = this.state.subeventsBasicId
                v.sureWay = v.sureWay === '用户勾选' ? 1 : 2
                v.auditWay = v.auditWay === '不需审核' ? 1 : v.auditWay === '系统内审核' ? 2 : v.auditWay === '系统内抄送' ? 3 : 4
                v.subeventsBasicWeight = Number(v.subeventsBasicWeight)

                if (this.state.insertOrUpdate == 1) {
                    request({
                        url: '/pm-web/projectmanage/subeventsbasicinfo/insertSubeventsBasicInfo',
                        method: 'POST',
                        data: v
                    }).then(data => {
                        // console.log(data)
                        if (data.rc === 0) {
                            message.success("新增成功!")
                            this.getTreeId()
                        }
                    })
                } else {
                    request({
                        url: '/pm-web/projectmanage/subeventsbasicinfo/updateSubeventsBasicInfo',
                        method: 'POST',
                        data: v
                    }).then(data => {
                        // console.log(data)
                        if (data.rc === 0) {
                            message.success("修改成功!")
                            this.getTreeId()
                        }
                    })
                }
            }
        });
    };
    //根据id查询详细信息并且重新获取事件树
    getTreeId = () => {
        this.setState({
            spinning: true
        })
        //根据事件id获取子级事件树结构
        request({
            url: '/pm-web/projectmanage/subeventsbasicinfo/getTreeByEventBasicId',
            method: 'POST',
            data: { eventBasicId: this.props.eventBasicId }
        }).then(data => {

            if (data.rc === 0) {
                this.setState({
                    treeData: data.ret.treeList,
                    selectedKeys: this.state.selectedKeys,
                    expandedKeys: data.ret.treeId
                })

                //根据id获取详情
                request({
                    url: '/pm-web/projectmanage/subeventsbasicinfo/findOne',
                    method: 'POST',
                    data: { subeventsBasicId: this.state.selectedKeys[0] }
                }).then(data => {
                    // console.log(data)
                    if (data.rc === 0) {
                        this.setState({
                            spinning: false,
                            shanChu: data.ret.shanChu,
                            shangYi: data.ret.shangYi,
                            xiaYi: data.ret.xiaYi,
                            xinZengTongJi: data.ret.xinZengTongJi,
                            xinZengXiaJi: data.ret.xinZengXiaJi,
                            insertOrUpdate: data.ret.insertOrUpdate,//1新增2编辑
                        })
                    }
                })

            }
        })
    }
    // 筛选条件组件change事件
    getChangeValue(value, bzArr, e) {
        let t = this;
        let params = {};
        params[value] = e.target.value;
        t.setState({ params });
    }
    onCheckbox(value, e) {
        let t = this;
        let params = {};
        params[value] = e.target.value;
        t.setState({ params });
    }
    //计算文本域内数字个数
    onChangeNum = (v) => {
        var strs = getByteLen(v);
        function getByteLen(val) {
            strs = val.replace(/[\ |\~|\`|\!|\@|\#|\$|\%|\^|\&|\*|\(|\)|\-|\_|\+|\=|\||\\|\[|\]|\{|\}|\;|\:|\"|\'|\,|\<|\.|\>|\/|\?|\，|\。|\？|\：|\；|\‘|\’|\”|\“|\、|\·|\！|\（|\）|\》|\《|\『|\』]/g, "");
            return strs;
        }
        return strs.length
    }

    //子级事件区域
    getChangeValueSon = (value, e) => {
        // console.log(value, e.target.value)
        let t = this;
        let params = {};
        params[value] = e.target.value;
        t.setState({ params });
        //form表单赋值-----改变文本域数字个数
        this.props.form.setFieldsValue({ [value]: e.target.value })
        this.addChangeSon(value, e.target.value.length)
    }
    addChangeSon = (v, num) => {
        this.state.sonArrList.forEach(item => {
            if (item.paramName === v) {
                item.title = `${num}/${item.num}`
            }
        });
    }
    selectedChange(fun, nextParams, paramName, value) {
        // console.log(fun, nextParams, paramName, value)
        //当选择了子级责任部门后,随之改变确认用户
        if (paramName === 'responsibleDepartmentId') {
            request({
                url: '/pm-web/projectmanage/role/getTreeData',
                method: 'POST',
                data: { parentId: '', roleLevel: "" }
            }).then(data => {
                // console.log(data)
                if (data.rc === 0) {

                    this.state.sonArrList[5].treeData = data.ret
                    //设置为返回数组第一用户
                    this.setState(
                        {
                            sonArrList: this.state.sonArrList
                        },
                        () => {
                            //给子级确认部门焦点
                            // this.props.form.validateFields(['confirmUserRoleId'], { force: true });
                        },
                    );
                }
            })
        }

        if (value === '系统内审核') {
            this.state.sonArrList.push(
                {
                    type: 'treeSelect',
                    paramName: 'eventAuditRoleList',
                    id: 'eventAuditRoleList',
                    title: '0/200',
                    num: 200,
                    key: "eventAuditRoleList",
                    label: '子级审核用户',
                    rules: [{ ...config.reg.required }],
                    treeCheckable: true,
                    span: 24,
                    shuoming: styles.zishijianshuoming,
                    style: { width: 750 },
                    treeData: this.state.treeArr

                },
                {
                    type: 'treeSelect',
                    paramName: 'eventAuditCCRoleList',
                    id: 'eventAuditCCRoleList',
                    title: '0/200',
                    num: 200,
                    key: "eventAuditCCRoleList",
                    label: '子级抄送用户',
                    treeCheckable: true,
                    span: 24,
                    shuoming: styles.zishijianshuoming,
                    className: styles.outcomeDocument,
                    style: { width: 750 },
                    treeData: this.state.treeArr
                })
            this.state.sonArrList.forEach((item, index) => {
                if (item.label === 'OA审批流') {
                    this.state.sonArrList.splice(index, 1)
                }
                if (item.label === '子级抄送用户') {
                    if (item.rules) {
                        this.state.sonArrList.splice(index, 1)
                    }
                }
            });
            this.setState({
                sonArrList: this.state.sonArrList
            })
        }

        if (value === '系统内抄送') {
            this.state.sonArrList.forEach((item, index) => {

                if (item.label == '子级审核用户') {
                    this.state.sonArrList.splice(index, 2)
                }

                if (item.label == 'OA审批流') {
                    this.state.sonArrList.splice(index, 1)
                }


            });


            setTimeout(() => {
                this.state.sonArrList.push(
                    {
                        type: 'treeSelect',
                        paramName: 'eventAuditCCRoleList',
                        id: 'eventAuditCCRoleList',
                        title: '0/200',
                        num: 200,
                        key: "eventAuditCCRoleList",
                        label: '子级抄送用户',
                        rules: [{ ...config.reg.required }],
                        treeCheckable: true,
                        span: 24,
                        shuoming: styles.zishijianshuoming,
                        style: { width: 750 },
                        treeData: this.state.treeArr
                    })
                this.setState({
                    sonArrList: this.state.sonArrList
                })
            }, 200)

        }
        //选择不需审核 删除抄送和审核用户2项
        if (value === 'OA审批' || value === '不需审核') {
            this.state.sonArrList.forEach((item, index) => {

                if (item.label == '子级审核用户') {
                    this.state.sonArrList.splice(index, 2)
                }

                if (item.label == '子级抄送用户') {
                    this.state.sonArrList.splice(index, 1)
                }
            });
        }

        let t = this;
        let params = {};
        params[paramName] = value;
        if (paramName) {
            t.setState({ params }, () => {
            });
        }
        if (typeof fun === "function") {
            fun(value);
            if (nextParams)
                t.props.form.setFieldsValue({
                    [nextParams]: ''
                })
        }
    }

    onExpand = expandedKeys => {
        this.setState({
            expandedKeys,
            autoExpandParent: false,
        });
    };

    onCheck = checkedKeys => {
        this.setState({ checkedKeys });
    };

    onSelect = (selectedKeys, info) => {
        if (selectedKeys.length < 1) {
            return
        }
        this.setState({ selectedKeys });
        //根据id获取详情
        this.getfindOne(selectedKeys[0])

    };

    renderTreeNodes = data =>
        data.map(item => {
            if (item.children) {
                return (
                    <TreeNode title={PublicTemplate.stringToEllipsis(item.title,14)} key={item.key} dataRef={item}>
                        {this.renderTreeNodes(item.children)}
                    </TreeNode>
                );
            }
            return <TreeNode key={item.key} {...item} />;
        });
    //添加下级子级事件
    ontianjiaZi = () => {
        request({
            url: '/pm-web/projectmanage/subeventsbasicinfo/getTreeByEventBasicId',
            method: 'POST',
            data: { eventBasicId: this.props.eventBasicId, id: this.state.selectedKeys[0], isEqual: 0 }
        }).then(data => {
            if (data.rc === 0) {
                this.setState({
                    treeData: data.ret.treeList,
                    selectedKeys: data.ret.defaultStr,
                    expandedKeys: data.ret.treeId
                })

                //根据id获取详情
                this.getfindOne(this.state.selectedKeys[0]);
            }
        })
    }

    //添加同级事件
    ontianjiaTong = () => {
        request({
            url: '/pm-web/projectmanage/subeventsbasicinfo/getTreeByEventBasicId',
            method: 'POST',
            data: { eventBasicId: this.props.eventBasicId, id: this.state.selectedKeys[0], isEqual: 1 }
        }).then(data => {
            if (data.rc === 0) {
                this.setState({
                    treeData: data.ret.treeList,
                    selectedKeys: data.ret.defaultStr,
                    expandedKeys: data.ret.treeId
                })
                //根据id获取详情
                this.getfindOne(this.state.selectedKeys[0]);
            }
        })
    }

    //删除
    onDelte = () => {
        request({
            url: '/pm-web/projectmanage/subeventsbasicinfo/deleteSubeventsBasicInfo',
            method: 'POST',
            data: this.state.selectedKeys[0]
        }).then(data => {
            if (data.rc === 0) {
                message.success('删除成功!')
                //查询事件树
                request({
                    url: '/pm-web/projectmanage/subeventsbasicinfo/getTreeByEventBasicId',
                    method: 'POST',
                    data: { eventBasicId: this.props.eventBasicId }
                }).then(data => {
                    if (data.rc === 0) {
                        this.setState({
                            treeData: data.ret.treeList,
                            selectedKeys: data.ret.defaultStr,
                            expandedKeys: data.ret.treeId
                        })
                        this.getfindOne(data.ret.defaultStr[0]);
                    }
                })

            } else {
                message.warning(`${data.err}`)
            }
        })
    }

    getfindOne = (id) => {
        //根据id获取详情
        request({
            url: '/pm-web/projectmanage/subeventsbasicinfo/findOne',
            method: 'POST',
            data: { subeventsBasicId: id }
        }).then(data => {
            if (data.rc === 0) {
                this.props.form.resetFields();//重置from表单所有值
                const { dutyTreeData, allTreeData, getTreeDataAn } = this.state;
                let finOneData = findOne(data, dutyTreeData, allTreeData, getTreeDataAn);
                if (data.ret.object.hierarchy != 1) {
                    finOneData[1].styleLable = { display: 'none' }
                } else {
                    finOneData[1].styleLable = { display: '' }
                }
                this.setState({
                    shanChu: data.ret.shanChu,
                    shangYi: data.ret.shangYi,
                    xiaYi: data.ret.xiaYi,
                    xinZengTongJi: data.ret.xinZengTongJi,
                    xinZengXiaJi: data.ret.xinZengXiaJi,
                    parentEventId: data.ret.object.parentEventId,
                    hierarchy: data.ret.object.hierarchy,
                    eventBasicId: this.props.eventBasicId,
                    subeventsBasicId: data.ret.object.subeventsBasicId,
                    insertOrUpdate: data.ret.insertOrUpdate,//1新增2编辑
                    sonArrList: finOneData

                })
            }
        })
    }

    //上移
    onUp = () => {
        request({
            url: '/pm-web/projectmanage/subeventsbasicinfo/updateSubeventsBasicInfoNum',
            method: 'POST',
            data: { subeventsBasicId: this.state.selectedKeys[0], direction: 'up' }
        }).then(data => {
            if (data.rc === 0) {
                message.success('上移成功!')
                //查询事件树
                request({
                    url: '/pm-web/projectmanage/subeventsbasicinfo/getTreeByEventBasicId',
                    method: 'POST',
                    data: { eventBasicId: this.props.eventBasicId }
                }).then(data => {
                    if (data.rc === 0) {
                        this.setState({
                            treeData: data.ret.treeList,
                            selectedKeys: this.state.selectedKeys,
                            expandedKeys: this.state.selectedKeys
                        })
                        //根据id获取详情
                        this.getfindOne(data.ret.defaultStr[0])
                    }
                })

            } else {
                message.warning('上移失败')
            }
        })
    }

    //下移
    onDown = () => {
        request({
            url: '/pm-web/projectmanage/subeventsbasicinfo/updateSubeventsBasicInfoNum',
            method: 'POST',
            data: { subeventsBasicId: this.state.selectedKeys[0], direction: 'below' }
        }).then(data => {
            if (data.rc === 0) {
                message.success('下移成功!')
                //查询事件树
                request({
                    url: '/pm-web/projectmanage/subeventsbasicinfo/getTreeByEventBasicId',
                    method: 'POST',
                    data: { eventBasicId: this.props.eventBasicId }
                }).then(data => {
                    if (data.rc === 0) {
                        this.setState({
                            treeData: data.ret.treeList,
                            selectedKeys: this.state.selectedKeys,
                            expandedKeys: this.state.selectedKeys
                        })
                        //根据id获取详情
                        this.getfindOne(data.ret.defaultStr[0]);
                    }
                })

            } else {
                message.warning('下移失败')
            }
        })
    }

    confirm = (e) => {

        this.onDelte()
    }

    cancel = (e) => {

    }

    render() {
        let t = this;
        let { getFieldDecorator } = t.props.form;
        return (
            <Spin spinning={this.state.spinning} size='large'>
                <div style={{ width: '100%', height: '100vh', display: 'flex', flexDirection: 'column' }}>
                    <Row>
                        <h2 style={{ fontSize: 14, fontWeight: 700 }}>

                            <span style={{ padding: 3, marginLeft: 15, cursor: 'pointer', color: '#3996FF', display: this.state.xinZengTongJi ? '' : 'none' }} onClick={this.ontianjiaTong}>
                                <IconFont type="icon-xinzeng" />  添加同级事件
                        </span>

                            <span style={{ padding: 3, marginLeft: 15, cursor: 'pointer', color: '#3996FF', display: this.state.xinZengXiaJi ? '' : 'none' }} onClick={this.ontianjiaZi}>
                                <IconFont type="icon-xinzeng" />  添加子级事件
                        </span>

                            <span onClick={this.onUp} style={{ padding: 3, marginLeft: 15, fontSize: 14, cursor: 'pointer', width: 20, height: 20, color: '#16B8BD', display: this.state.shangYi ? '' : 'none' }}>
                                <IconFont type="icon-shangyi" />
                                上移
                            </span>

                            <span onClick={this.onDown} style={{ padding: 3, marginLeft: 15, fontSize: 14, cursor: 'pointer', width: 20, height: 20, color: '#F58989', display: this.state.xiaYi ? '' : 'none' }}>
                                <IconFont type="icon-xiayi2" />
                                下移
                            </span>

                            <Popconfirm
                                title="确定删除此条数据?"
                                onConfirm={this.confirm}
                                onCancel={this.cancel}
                                okText="是"
                                cancelText="否"
                            >
                                <span style={{ padding: 3, marginLeft: 15, fontSize: 14, cursor: 'pointer', width: 20, height: 20, color: '#F58989', display: this.state.shanChu ? '' : 'none' }}>
                                    <IconFont type="icon-shanchu" />
                                    删除
                                </span>
                            </Popconfirm>

                            <span style={{ padding: 3, marginLeft: 15, cursor: 'pointer', color: '#3996FF' }} onClick={this.onModalSave}>
                                <IconFont type="icon-tongyi" />  保存
                        </span>

                        </h2>
                    </Row>
                    <div style={{ flex: '1', display: 'flex', paddingBottom: 50 }}>
                        <div style={{ width: 230, backgroundColor: '#F5F6F7', display: 'flex' }}>

                            <Tree
                                // defaultExpandAll={true}
                                onExpand={this.onExpand}
                                expandedKeys={this.state.expandedKeys}
                                // autoExpandParent={this.state.autoExpandParent}
                                onSelect={this.onSelect}
                                selectedKeys={this.state.selectedKeys}
                            >
                                {this.renderTreeNodes(this.state.treeData)}
                            </Tree>

                        </div>
                        <Form layout={'inline'} style={{ padding: 10, flex: 1 }} >
                            <Row gutter={24}>
                                {
                                    this.state.sonArrList.map((item, index) => {
                                        if (item.type === 'TextArea') {
                                            return (
                                                <Col span={item.span} key={index} style={{ paddingTop: 10 }}>
                                                    <Form.Item wrapperCol={item.wrapperCol || null} labelCol={item.labelCol || null} label={item.label} key={item.paramName} className={item.className} style={item.styleLable}>
                                                        <Tooltip
                                                            trigger={['focus']}
                                                            title={item.title}
                                                            placement="topLeft"
                                                            overlayClassName="numeric-input"
                                                        >
                                                            {
                                                                getFieldDecorator(item.paramName, {
                                                                    initialValue: item.initialValue ? item.initialValue : '',
                                                                    rules: item.styleLable ? null : item.rules || null
                                                                })(

                                                                    <TextArea
                                                                        style={item.style}
                                                                        placeholder={item.placeholder}
                                                                        // onChange={this.onChange}
                                                                        className={item.shuoming}
                                                                        rows={item.rows}
                                                                        maxLength={item.num}
                                                                        disabled={item.disabled} id={[item.paramName]}
                                                                        onChange={this.getChangeValueSon.bind(this, item.paramName)} size={config.size}
                                                                    />

                                                                )
                                                            }
                                                        </Tooltip>
                                                    </Form.Item>
                                                </Col>
                                            )
                                        } else if (item.type === 'select') {
                                            return (
                                                <Col span={item.span} key={index} style={{ paddingTop: 10 }}>
                                                    <Form.Item label={item.label} key={item.paramName} className={item.className} style={item.styleLable} >
                                                        {
                                                            getFieldDecorator(item.paramName, {
                                                                initialValue: item.initialValue ? item.initialValue : (item.options[0] ? Util.numToString(item.options[0].value) : item.options[0]),
                                                                rules: item.rules || null
                                                            })(
                                                                <Select
                                                                    size={config.size}
                                                                    showSearch
                                                                    mode={item.mode}
                                                                    placeholder="Select a person"
                                                                    style={{ width: item.width || 170 }}
                                                                    optionFilterProp="children"
                                                                    dropdownMatchSelectWidth={t.props.dropdownMatchSelectWidth}
                                                                    onChange={t.selectedChange.bind(t, item.selectChange, item.nextParamName || false, item.paramName)}
                                                                    onSelect={item.onSelect}
                                                                    disabled={item.disabled}
                                                                    style={item.style}
                                                                    className={item.shuoming}
                                                                >
                                                                    {
                                                                        item.options.map(option => {
                                                                            return (
                                                                                <Select.Option key={option.value}
                                                                                    value={Util.numToString(option.value)}
                                                                                >
                                                                                    {option.text}
                                                                                </Select.Option>

                                                                            )
                                                                        })
                                                                    }
                                                                </Select>
                                                            )
                                                        }
                                                    </Form.Item>
                                                </Col>
                                            )
                                        } else if (item.type === 'treeSelect') {
                                            return (
                                                <Col span={item.span} key={index} style={{ paddingTop: 10 }}>
                                                    <Form.Item label={item.label} key={item.paramName} className={item.className} >
                                                        {
                                                            getFieldDecorator(item.paramName, {
                                                                initialValue: item.initialValue ? item.initialValue : null,
                                                                rules: item.rules || null
                                                            })(
                                                                <TreeSelect
                                                                    treeData={item.treeData}
                                                                    maxTagCount={5}
                                                                    onChange={t.selectedChange.bind(t, item.selectChange, item.nextParamName || false, item.paramName)}
                                                                    treeCheckable={item.treeCheckable}
                                                                    showCheckedStrategy={SHOW_CHILD}
                                                                    // searchPlaceholder={'请选部门'}
                                                                    style={item.style}
                                                                    className={item.shuoming}
                                                                />
                                                            )
                                                        }
                                                    </Form.Item>
                                                </Col>
                                            )
                                        }


                                    })
                                }

                            </Row>

                        </Form>
                        {/* <div style={{width:50}}>123456</div> */}
                    </div>




                </div>
            </Spin>
        )
    }
}
export default Form.create()(SubEvent);
